home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / FLOAT / FPINIT.ASM < prev    next >
Assembly Source File  |  1989-01-24  |  2KB  |  67 lines

  1. ;
  2. ; This program originally available on the Motorola DSP bulletin board.
  3. ; It is provided under a DISCLAIMER OF WARRANTY available from
  4. ; Motorola DSP Operation, 6501 Wm. Cannon Drive W., Austin, Tx., 78735.
  5. ; Last Update 5 Oct 87   Version 2.0
  6. ;
  7. fpinit  ident   2,0
  8. ;
  9. ; MOTOROLA DSP56000/1 FPLIB - VERSION 2
  10. ;
  11. ; FPINIT - FLOATING POINT LIBRARY INITIALIZATION SUBROUTINE
  12. ;
  13. ; Entry point:  fpinit  Initialize address pointers and shift constant
  14. ;                       table for DSP56000/1 floating point subroutine
  15. ;                       library.
  16. ;
  17. ; Input variables:      none
  18. ;
  19. ; Output variables:
  20. ;
  21. ;       n0 = base address of shift constant table
  22. ;       m0 = $ffff  (linear address modifier)
  23. ;
  24. ;       shift constant table - stores multiplication constants for
  25. ;                              denormalization operations.
  26. ;
  27. ;       The X or Y data memory space (without the colon) used for the
  28. ;       shift constant table must be specified in single quotes by a
  29. ;       DEFINE directive for the global symbol "fp_space" and the base
  30. ;       address of the shift constant table must be specified for the
  31. ;       global symbol "fp_temp" via an EQU or similar directive.  An
  32. ;       example is given below.
  33. ;
  34. ;               define  fp_space        'x'
  35. ;       fp_temp equ     $0000
  36. ;
  37. ; Error conditions:     none
  38. ;
  39. ; Memory requirements:  28 locations in "fp_space" memory space
  40. ;
  41. ; Alters Address Registers
  42. ;               n0      m0
  43. ;
  44. ; Alters Program Control Registers
  45. ;       pc      sr
  46. ;
  47. ; Uses 0 locations on System Stack
  48. ;
  49. ;
  50.         org     fp_space:fp_temp
  51.         ds      4       ;temporary storage locations
  52. fp_23   dc      23      ;exponent delta limit
  53. fp_ebias dc     $001fff ;fixed point exponent bias
  54. fp_emax dc      $003fff ;maximum exponent
  55. fp_shift dc     $800000,$c00000,$e00000,$f00000,$f80000,$fc0000,$fe0000,$ff0000
  56.         dc      $ff8000,$ffc000,$ffe000,$fff000,$fff800,$fffc00,$fffe00,$ffff00
  57.         dc      $ffff80,$ffffc0,$ffffe0,$fffff0,$fffff8,$fffffc,$fffffe
  58. fp_m1   dc      $ffffff
  59. ;
  60.         org p:
  61. fpinit  move    fp_space:fp_m1,m0       ;initialize linear address modifier
  62.         move    #fp_shift,n0    ;initialize base address of shift constant table
  63.         and     #$f3,mr         ;reset scaling modes (S1,S0)
  64.         and     #$bf,ccr        ;reset overflow flag (L bit)
  65.         rts
  66.